<template>
    <div>
        <!-- 控制Table行的悬浮窗口 -->
        <div :class="floatBoxVisible?'float-box float-box-active':'float-box'">
            <button class="float-button" @click="tableBackup">
                <span class="el-icon-top"></span>
            </button>
            <button class="float-button" @click="tablePutdown">
                <span class="el-icon-bottom"></span>
            </button>
        </div>
        <!--高级搜索抽屉-->
        <el-drawer title="高级搜索" :size="drawerWidth" :before-close="handleClose" :visible.sync="drawerState" direction="rtl" ref="drawer">
            <el-container>
                <el-main>
                    <el-form :model="radiationParam" status-icon id="seniorSearchDrawer" ref="selectForm" :rules="selectFormRule">
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="dataId" label="数据编号" label-width="100px">
                                    <el-input v-model="radiationParam.dataId" auto-complete="off" clearable></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item label="数据来源" label-width="100px">
                                    <el-select v-model="radiationParam.areaId" placeholder="请选择部署区域">
                                        <el-option v-for="item in areaData" :key="item.areaId" :label="item.areaRemarks+' / '+item.areaName" :value="item.areaId" />
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item label="监测日期" label-width="100px">
                                    <el-date-picker v-model="radiationParam.date" value-format="yyyy-MM-dd HH:mm:ss"
                                                    type="datetimerange" :picker-options="pickerOptions"
                                                    range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                                                    align="right">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="alpha" label="α粒子计量" label-width="100px">
                                    <el-input v-model="radiationParam.alpha" auto-complete="off" clearable></el-input>
                                    <span class="input-tail">以下</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="beta" label="β粒子计量" label-width="100px">
                                    <el-input v-model="radiationParam.beta" auto-complete="off" clearable></el-input>
                                    <span class="input-tail">以下</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="gamma" label="γ射线计量" label-width="100px">
                                    <el-input v-model="radiationParam.gamma" auto-complete="off" clearable></el-input>
                                    <span class="input-tail">以下</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="humidity" label="空气湿度" label-width="100px">
                                    <el-input v-model="radiationParam.humidity" auto-complete="off" clearable></el-input>
                                    <span class="input-tail">以下</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item prop="temperature" label="空气温度" label-width="100px">
                                    <el-input v-model="radiationParam.temperature" auto-complete="off" clearable></el-input>
                                    <span class="input-tail">以下</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item label="风向" label-width="100px">
                                    <el-select v-model="radiationParam.windDirection" placeholder="请选择风向">
                                        <el-option v-for="item in wind.direction" :key="item.value" :label="item.label" :value="item.value">
                                            <span>{{item.label}}</span>
                                            <i :class="item.icon + ' select-icon'" />
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row type="flex" justify="center">
                            <el-col :span="20">
                                <el-form-item label="风力等级" label-width="100px">
                                    <el-select v-model="radiationParam.windForce" placeholder="请选择风力等级">
                                        <el-option v-for="item in wind.force" :key="item.value" :label="item.label" :value="item.value"/>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-main>
                <!--提交按钮-->
                <el-footer>
                    <el-row type="flex" justify="end">
                        <el-col :span="5">
                            <el-button @click="cancelForm">取 消</el-button>
                        </el-col>
                        <el-col :span="5">
                            <el-button type="primary" @click="$refs.drawer.closeDrawer()" :loading="drawerLoading">{{ drawerLoading ? '搜索中 ...' : '提交搜索' }}</el-button>
                        </el-col>
                    </el-row>
                </el-footer>
            </el-container>
        </el-drawer>
        <!--添加/搜索响应按钮行-->
        <el-row :gutter="20" type="flex" justify="start">
            <el-col :xl="4" :lg="5" :md="6" :sm="6" :xs="8">
                <el-input v-model="radiationParam.dataId" size="small" placeholder="按数据编号搜索..." clearable/>
            </el-col>
            <el-col :xl="10" :lg="9" :md="8" :sm="10" :xs="16">
                <el-button type="primary" size="small" icon="el-icon-search" @click="normalSelect">搜索</el-button>
                <el-button type="warning" size="small" icon="el-icon-warning" @click="alertSelect" class="alert-data-button">显示警报数据</el-button>
            </el-col>
            <el-col :xl="10" :lg="10" :md="10" :sm="8" class="hidden-xs-only">
                <el-button style="float: right" type="primary" size="small" icon="el-icon-link" @click="openDrawer" class="hidden-sm-and-down">高级搜索</el-button>
                <span class="span-font">当前显示：{{countDisplay}}</span>
            </el-col>
        </el-row>
        <!--table-->
        <el-table :data="this.radiationData.data" style="width: 100%" :height="tableHeight"
                  ref="radiationDataTable"
                  v-el-table-infinite-scroll="radiationDataLoad"
                  infinite-scroll-distance="10px"
                  infinite-scroll-delay="100"
                  :border="true"
                  :row-class-name="tableRowClassName"
                  header-cell-class-name="header-cell"
                  v-loading="tableLoading">
            <!--展开栏-->
            <el-table-column type="expand">
                <template slot-scope="props">
                    <el-form label-position="left" inline class="table-expand">
                        <el-form-item label="数据编号：">
                            <span>{{props.row.dataId}}</span>
                        </el-form-item>
                        <el-form-item label="α粒子：">
                            <span :class="props.row.alpha > 0.7? 'span-highlight':''">{{props.row.alpha}}</span>
                        </el-form-item>
                        <el-form-item label="空气湿度：">
                            <span>{{props.row.humidity}} %</span>
                        </el-form-item>
                        <el-form-item label="β粒子：">
                            <span :class="props.row.beta > 0.45? 'span-highlight':''">{{props.row.beta}}</span>
                        </el-form-item>
                        <el-form-item label="温度：">
                            <span>{{props.row.temperature}} ℃</span>
                        </el-form-item>
                        <el-form-item label="γ射线：">
                            <span :class="props.row.gamma > 0.3? 'span-highlight':''">{{props.row.gamma}}</span>
                        </el-form-item>
                        <el-form-item label="风力：">
                            <span>{{props.row.windForce}} 级</span>
                        </el-form-item>
                        <el-form-item label="风向：">
                            <span>{{props.row.windDirection}}风</span>
                        </el-form-item>
                        <el-form-item label="监测时间：">
                            <span>{{props.row.date}}</span>
                        </el-form-item>
                        <el-form-item label="数据来源：">
                            <span>{{getAreaName(props.row.areaId)}}</span>
                        </el-form-item>
                        <el-form-item label="监测设备：">
                            <span>{{props.row.equipmentId}}</span>
                        </el-form-item>
                        <el-form-item label="采集海拔：">
                            <span>{{getEquipmentAltitude(props.row.equipmentId)}} 米</span>
                        </el-form-item>
                        <el-form-item label="启用状态：">
                            <span v-if="props.row.enable" style="color: #68c176">激活</span>
                            <span v-if="!props.row.enable" style="color: #e05e5e">禁用</span>
                        </el-form-item>
                    </el-form>
                </template>
            </el-table-column>
            <!--略缩列表-->
            <el-table-column prop="dataId" label="ID" width="90" sortable></el-table-column>
            <el-table-column prop="areaId" label="数据来源" width="170" :show-overflow-tooltip="true" sortable>
                <template slot-scope="scope">{{getAreaName(scope.row.areaId)}}</template>
            </el-table-column>
            <el-table-column prop="date" label="监测时间" width="180" sortable></el-table-column>
            <el-table-column prop="alpha" label="α粒子" width="110" sortable>
                <template slot-scope="scope">
                    <span :class="scope.row.alpha > 0.7? 'span-highlight':''">{{scope.row.alpha}} uSv/h</span>
                </template>
            </el-table-column>
            <el-table-column prop="beta" label="β粒子" width="110" sortable>
                <template slot-scope="scope">
                    <span :class="scope.row.beta > 0.45? 'span-highlight':''">{{scope.row.beta}} uSv/h</span>
                </template>
            </el-table-column>
            <el-table-column prop="gamma" label="γ射线" width="110" sortable>
                <template slot-scope="scope">
                    <span :class="scope.row.gamma > 0.3? 'span-highlight':''">{{scope.row.gamma}} uSv/h</span>
                </template>
            </el-table-column>
            <el-table-column prop="humidity" label="空气湿度" width="110" align="center" header-align="left" sortable>
                <template slot-scope="scope">{{scope.row.humidity}} %</template>
            </el-table-column>
            <el-table-column prop="humidity" label="温度" width="90" sortable align="center" header-align="left" :sort-method="this.temperatureSort">
                <template slot-scope="scope">{{scope.row.temperature}} ℃</template>
            </el-table-column>
            <el-table-column prop="humidity" label="风向" width="90" align="center" header-align="left" :sort-method="this.temperatureSort">
                <template slot-scope="scope">{{scope.row.windDirection}}风</template>
            </el-table-column>
            <el-table-column prop="humidity" label="风力" width="90" align="center" header-align="left" :sort-method="this.temperatureSort">
                <template slot-scope="scope">{{scope.row.windForce}} 级</template>
            </el-table-column>
            <el-table-column prop="enable" label="数据状态" width="110" align="center" header-align="left">
                <template slot-scope="scope">
                    <span v-if="scope.row.enable" style="color: #68c176">激活</span>
                    <span v-if="!scope.row.enable" style="color: #e05e5e">禁用</span>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="150" align="center" header-align="left">
                <template slot-scope="scope">
                    <el-button v-if="!scope.row.enable" size="mini" type="primary" icon="el-icon-video-play" class="table-cell-button"
                               @click="enableReverse(scope.$index,scope.row)">解除禁用</el-button>
                    <el-button v-if="scope.row.enable" size="mini" type="danger" icon="el-icon-video-pause" class="table-cell-button table-cell-button-alert"
                               @click="enableReverse(scope.$index,scope.row)">禁用数据</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import elTableInfiniteScroll from "el-table-infinite-scroll";
import {mapState, mapActions} from "vuex";
import 'element-ui/lib/theme-chalk/display.css';

export default {
    name: "DataList",
    directives: {
        'el-table-infinite-scroll': elTableInfiniteScroll
    },
    data(){
        let validateId = (rule,value,callback)=> {
            if (value !== '') {
                let reg = /^[0-9]\d*$/;
                if (reg.test(value * 1)) {
                    callback()
                } else {
                    callback(new Error('请输入数据的正整数编号'))
                }
            }
            callback();
        };
        let validateNum = (rule,value,callback)=> {
            if (value !== '') {
                let reg = /^[0-9]+.?[0-9]*$/;
                if (reg.test(value * 1)) {
                    callback()
                } else {
                    callback(new Error('请输入正确的数字编号'))
                }
            }
            callback();
        };
        return{
            radiationParam: {},
            drawerState: false,
            drawerLoading: false,
            floatBoxVisible: false,
            timer: null,
            tableLoading: false,
            tableHeight: null,
            //用于提交搜索条件的表单验证规则
            selectFormRule:{
                dataId: [
                    {validator: validateId, trigger: 'blur'}
                ],
                alpha: [
                    {validator: validateNum, trigger: 'blur'}
                ],
                beta: [
                    {validator: validateNum, trigger: 'blur'}
                ],
                gamma: [
                    {validator: validateNum, trigger: 'blur'}
                ],
                humidity: [
                    {validator: validateNum, trigger: 'blur'}
                ],
                temperature: [
                    {validator: validateNum, trigger: 'blur'}
                ]
            },
            //供日期选择器快捷选项使用
            pickerOptions: {
                shortcuts: [
                    {
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    },
                    {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    },
                    {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }
                ]
            }
        }
    },
    methods: {
        ...mapActions([
            "initRadiationData",
            "initAreas",
            "initEquipments",
            "updateDataParam",
            "addRadiationData",
            "selectRadiationData",
            "reverseDataEnable"
        ]),
        getTableHeight(){
            this.tableHeight = window.innerHeight - 60 - (40 + 14 + 30) - 38 - (33 + 20);
        },
        tableBackup(){
            // this.$refs.radiationDataTable.bodyWrapper.scrollTop = 0;
            let dom = this.$refs.radiationDataTable;
            let step = Math.ceil(dom.bodyWrapper.scrollTop / 15);
            let timer = setInterval(function (){
                let nowPosition = dom.bodyWrapper.scrollTop;
                if(nowPosition > step){
                    dom.bodyWrapper.scrollTop = nowPosition - step;
                }else{
                    dom.bodyWrapper.scrollTop = 0;
                    clearInterval(timer);
                }
            },30)
        },
        tablePutdown(){
            // this.$refs.radiationDataTable.bodyWrapper.scrollTop = this.$refs.radiationDataTable.bodyWrapper.scrollHeight;
            let dom = this.$refs.radiationDataTable;
            let nowPosition = dom.bodyWrapper.scrollTop;
            let totalHeight = dom.bodyWrapper.scrollHeight;
            let clientHeight = dom.bodyWrapper.clientHeight;
            let step = Math.ceil((totalHeight - nowPosition) / 15);
            let timer = setInterval(function (){
                let left = totalHeight - dom.bodyWrapper.scrollTop - clientHeight;
                if(left > step){
                    dom.bodyWrapper.scrollTop += step;
                }else{
                    dom.bodyWrapper.scrollTop = totalHeight;
                    clearInterval(timer);
                }
            },30)
        },
        radiationDataLoad(){
            if(this.radiationListParams.pageSize * this.radiationListParams.currentPage<this.radiationData.total){
                //翻页(通过commit更新整个radiationListParams)
                let params = this.radiationListParams;
                params.currentPage++;
                this.updateDataParam(params);
                //开启加载动画
                this.tableLoading = true;
                //发送异步请求
                this.addRadiationData();
                //设置加载动画结束计时器
                this.timer = setTimeout(()=>{
                    this.tableLoading = false;
                    this.$message.success("加载第"+this.radiationListParams.currentPage+"页");
                },1000);
            }else{
                this.$message.info("已到底");
            }
        },
        getAreaName(areaId){
            if(this.areaData.length !== 0){
                return this.areaData.find(item=>item.areaId === areaId).areaName;
            }
            return "";
        },
        getEquipmentAltitude(equipmentId){
            if(this.equipmentData.data.length !== 0){
                return this.equipmentData.data.find(item=>item.equipmentId === equipmentId).altitude;
            }
            return "";
        },
        temperatureSort(currentRow,nextRow) {
            if (currentRow.temperature >= nextRow.temperature) {
                return 1;
            } else {
                return -1;
            }
        },
        enableReverse(index,data){
            let params = {
                data: data
            }
            this.reverseDataEnable(params);
        },
        normalSelect() {
            //开启加载动画
            this.tableLoading = true;
            //切换搜索模式为普通搜索
            this.radiationParam.isAlert = 0;
            //判断搜索框中是否有内容,如果没有则重置搜索参数,并初始化RadiationDataList内容
            if (!this.radiationParam.dataId) {
                this.initRadiationParam();
                this.initRadiationData();
            }
            //提交搜索参数状态到Vuex
            this.updateDataParam(this.radiationParam);
            //提交搜索请求
            this.selectRadiationData();
            //延时动画设置
            setTimeout(() => {
                this.tableLoading = false;
            }, 400)
        },
        alertSelect(){
            //开启加载动画
            this.tableLoading = true;
            //初始化搜索参数
            this.initRadiationParam();
            //更改搜索参数中的isAlert参数,变更为alert数据搜索模式
            this.radiationParam.isAlert = 1;
            //提交状态到Vuex
            this.updateDataParam(this.radiationParam);
            //提交搜索请求
            this.selectRadiationData();
            //延时动画设置
            setTimeout(() => {
                this.tableLoading = false;
            }, 400)
        },
        tableRowClassName({row,rowIndex}) {
            if (row.alpha > 0.7 || row.beta > 0.45 || row.gamma > 0.3) {
                return 'row-background-warning';
            }
            if ((rowIndex + 1) % 3 === 0) {
                if ((rowIndex + 1) / 3 % 2 === 0) {
                    return 'row-background-default row-background-blue';
                } else {
                    return 'row-background-default row-background-grey';
                }
            } else {
                return 'row-background-default';
            }
        },
        openDrawer(){
            this.drawerState = true;
            this.initRadiationParam();
        },
        handleClose(done) {
            if (this.drawerLoading) {
                return;
            }
            this.$confirm('确定要提交表单吗？').then(_ => {
                this.$refs.selectForm.validate((valid)=>{
                    if(valid){
                        this.tableLoading = true;
                        this.drawerLoading = true;
                        this.timer = setTimeout(() => {
                            done();
                            // 动画关闭需要一定的时间
                            setTimeout(() => {
                                this.tableLoading = false;
                                this.drawerLoading = false;
                            }, 400);
                        }, 1500);
                        //提交参数状态到Vuex中
                        this.updateDataParam(this.radiationParam)
                        //提交搜索请求
                        this.selectRadiationData();
                    }else{
                        this.$message.error("表单验证不通过")
                    }
                })
            }).catch(_ => {
                this.cancelForm();
            })
        },
        cancelForm() {
            this.drawerLoading = false;
            this.drawerState = false;
            clearTimeout(this.timer);
            this.initRadiationParam();
        },
        initRadiationParam(){
            //初始化Param
            this.radiationParam.currentPage = 1;
            this.radiationParam.pageSize = 20;
            this.radiationParam.dataId = '';
            this.radiationParam.alpha = '';
            this.radiationParam.beta = '';
            this.radiationParam.gamma = '';
            this.radiationParam.humidity = '';
            this.radiationParam.temperature = '';
            this.radiationParam.windForce = '';
            this.radiationParam.windDirection = '';
            this.radiationParam.date = [];
            this.radiationParam.areaId = '';
            this.radiationParam.equipmentId = '';
            this.radiationParam.isAlert = 0;
        }
    },
    computed: {
        ...mapState({
            radiationData: state => state.active.radiationData,
            areaData: state => state.active.areaData,
            equipmentData: state => state.active.equipmentData,
            radiationListParams: state => state.static.radiationListParams,
            wind: state => state.static.wind
        }),
        countDisplay(){
            if(this.radiationData.data){
                return this.radiationData.data.length + '/' + this.radiationData.total;
            }
            return "";
        },
        drawerWidth(){
            let windowWidth= document.documentElement.clientWidth;
            if(windowWidth >= 1440){
                return '30%';
            }else if(windowWidth >= 1165){
                return '40%';
            }else if(windowWidth >= 992){
                return '45%';
            }
            return '50%';
        }
    },
    created() {
        //绑定事件来适应窗口大小的变化,做到自适应高度
        window.addEventListener("resize",this.getTableHeight,false);
        this.getTableHeight();

        //将页码重新设置成第一页
        let params = this.radiationListParams;
        params.currentPage = 1;
        this.updateDataParam(params);

        //拷贝state中的param数据到本页面
        this.radiationParam = JSON.parse(JSON.stringify(this.radiationListParams))

        //判断Vuex中是否已经存有数据,避免多次请求服务器
        if(this.radiationData.total){
            return
        }

        //初始化
        this.initRadiationData();
        //同时发现了本页面在来回切换时没有<keep-alive>的问题
        //这里两个init有缺陷先将就着用,需要获取所有Area和Equipment数据才算完整,同时还要做避免重复操作的判断
        this.initAreas();
        this.initEquipments();
    },
    mounted() {
        //为el-table绑定滚动条事件
        //获取table的dom对象
        this.dom = this.$refs.radiationDataTable.bodyWrapper;
        this.dom.addEventListener('scroll',()=>{
            //获取滚动的距离
            let scrollTop = this.dom.scrollTop;
            if(scrollTop >= 400){
                if(!this.floatBoxVisible){
                    this.floatBoxVisible = true;
                }
            }else{
                if(this.floatBoxVisible){
                    this.floatBoxVisible = false;
                }
            }
        })
    },
    watch: {

    }
}
</script>

<style scoped>
.el-row{
    margin-bottom: 20px;
}

.el-row:last-child{
    margin-bottom: 0px;
}

::v-deep .row-background-warning{
    background: oldlace;
}

::v-deep .row-background-default{
    background-color: #ffffff;
}
::v-deep .row-background-default:hover{
    transition: background-color .15s;
    background-color: #f5f7fa;
}

::v-deep .row-background-grey{
    background-color: #f9f9f9;
}

::v-deep .row-background-blue{
    background-color: #f5faff;
}

::v-deep .el-table__body-wrapper::-webkit-scrollbar{
    width: 8px;
}

::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb{
    background-color: #eaeaea;
    border-radius: 8px;
}

.form-item-select{
    width: 100%;
}

.select-icon{
    float: right;
    height: 100%;
    display: flex;
    align-items: center;
}

::v-deep .header-cell{
    font-size: 14px;
    font-weight: bold;
    color: #606266;
    background-color: #ffffff00 !important;
}

::v-deep .has-gutter tr{
    /*background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);*/
    background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
}

::v-deep .el-table__cell{
    background-color: #ffffff00 !important;
}

.span-highlight{
    color: #e05e5e;
}

.table-cell-button{
    padding: 7px;
    margin-right: 10px;
}

.table-cell-button-alert{
    background-color: #ff8029;
    border-color: #ff8029;
}

.table-cell-button-alert:hover{
    background-color: #ff8029cc;
    border-color: #ff8029cc;
}

.table-cell-span-normal{
    display: block;
    width: 10px;
    height: 10px;
    margin: auto;
    border-radius: 10px;
    background-color: #68c176;
}

.table-cell-span-lag{
    display: block;
    width: 10px;
    height: 10px;
    margin: auto;
    border-radius: 10px;
    background-color: #ff8029;
}

.table-cell-span-error{
    display: block;
    width: 10px;
    height: 10px;
    margin: auto;
    border-radius: 10px;
    background-color: #e05e5e;
}

::v-deep .el-progress{
    width: 80%;
}

::v-deep #seniorSearchDrawer .el-form-item__label{
    text-align: left;
}

.table-expand{
    font-size: 0;
}

::v-deep .table-expand label{
    width: 90px;
    color: #99a9bf;
}

::v-deep .table-expand .el-form-item{
    padding-left: 20px;
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
}

.input-tail{
    width: 80px;
    display: flex;
    justify-content: center;
}

.span-font{
    float: right;
    font-size: 13px;
    font-weight: bold;
    color: #606266;
    height: 100%;
    line-height: 33px;
    margin-right: 20px;
}

.alert-data-button{
    height: 32px;
}

::v-deep #seniorSearchDrawer .el-row{
    height: 50px;
}

/*去除在使用el-input时,type='number'后出现的两个上下箭头*/
::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

::v-deep input[type="number"]{
    -moz-appearance: textfield;
}

.float-box{
    position: fixed;
    right: 50px;
    bottom: 100px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    justify-content: space-around;

    width: 50px;
    height: 120px;
    font-size: 20px;
    border: 0px;
    z-index: 5;

    transition: all 0.6s ease-in-out;
    opacity: 0;
}

.float-box-active{
    opacity: 1;
}

.float-button{
    height: 50px;
    width: 50px;
    background-color: #66b1ff;
    box-shadow: rgba(0, 0, 0, 0.12) 0 0 6px;
    text-align: center;
    line-height: 50px;
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.float-button:hover{
    background-color: #409eff;
}

::v-deep .has-gutter .gutter{
    background-color: #ffffff !important;
    border: 0 !important;
}

@media screen and (max-width: 768px) {

    .alert-data-button{
        height: 33px;
        float: right;
    }
}
</style>